package com.kamistoat.meimeimall.meimeimallpayment.service.impl;

import com.kamistoat.meimeimall.common.annotation.WithCache;
import com.kamistoat.meimeimall.common.constant.DatabaseConstant;
import com.kamistoat.meimeimall.common.constant.PaymentConstant;
import com.kamistoat.meimeimall.meimeimallpayment.dao.ReconciliationErrorDao;
import com.kamistoat.meimeimall.meimeimallpayment.entity.ReconciliationErrorEntity;
import com.kamistoat.meimeimall.meimeimallpayment.service.ReconciliationErrorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("reconciliationErrorService")
public class ReconciliationErrorServiceImpl implements ReconciliationErrorService {
    protected Logger logger = LoggerFactory.getLogger(ReconciliationErrorServiceImpl.class);

    @Autowired
    ReconciliationErrorDao reconciliationErrorDao;

    /**
     * 获取指定任务的坏账列表
     *
     * @param taskId
     * @return
     */
    @Override
    public List<ReconciliationErrorEntity> getErrorListByTaskId(Long taskId, Integer pageSize, Integer page) {
        String errTableName = PaymentConstant.RECONCILIATION_ERROR_PREFIX + taskId;
        return reconciliationErrorDao.selectAllInPage(errTableName, pageSize, (page - 1) * pageSize);
    }
}
